package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.Logistics;
import com.ruoyi.system.mapper.LogisticsMapper;
import com.ruoyi.system.service.ILogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 单据Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-26
 */
@Service
public class LogisticsServiceImpl implements ILogisticsService {

    @Autowired
    private LogisticsMapper logisticsMapper;

    /**
     * 查询单据
     *
     * @param id 单据主键
     * @return 单据
     */
    @Override
    public Logistics selectLogisticsById(Long id) {
        return logisticsMapper.selectLogisticsById(id);
    }

    /**
     * 查询单据列表
     *
     * @param logistics 单据
     * @return 单据
     */
    @Override
    public List<Logistics> selectLogisticsList(Logistics logistics) {
        return logisticsMapper.selectLogisticsList(logistics);
    }

    /**
     * 新增单据
     *
     * @param logistics 单据
     * @return 结果
     */
    @Override
    public int insertLogistics(Logistics logistics) {
        return logisticsMapper.insertLogistics(logistics);
    }

    /**
     * 签收单据单据
     *
     * @param logistics 单据
     * @return 结果
     */
    @Override
    public int signLogistics(Logistics logistics) {
        return logisticsMapper.updateLogistics(logistics);
    }

    /**
     * 批量删除单据
     *
     * @param ids 需要删除的单据主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsByIds(String ids) {
        return logisticsMapper.deleteLogisticsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除单据信息
     *
     * @param id 单据主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsById(Long id) {
        return logisticsMapper.deleteLogisticsById(id);
    }
}
